package com.z6school.manage.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.z6school.manage.po.RoleMenus;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RolesMenusMapper extends BaseMapper<RoleMenus> {

   int doDeleteObject( @Param("column") String column,
                        @Param("id") Integer id);

   @Delete("delete from role_menu where roleId=#{roleId}")
   int deleteObjectByRoleId(@Param("roleId") Integer roleId);

   int insertObjects(@Param("roleId") Integer roleId,
                     @Param("menuIds") Integer[] menuIds);

   @Select("select menuId from role_menu where roleId=#{roleId}")
   List<Integer> findMenuIdsByRoleId(Integer roleId);

   List<Integer> findMenuIdsByRoleIds(
           @Param("roleIds")List<Integer> roleIds);

}
